Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor request execution and use IPLD SkipMe functionality for proper partial results on a request #70

Merged
merged 3 commits into from
Jul 1, 2020

Conversation

hannahhoward
Copy link
Collaborator

Goals

In preparation for adding pause/resume to the request side of graphsync, refactor some code into a request "executor module". Also properly implement skipping parts of the tree that are missing -- at the time we originally wrote graphsync, IPLD selectors had not abilty to "skip" on block load errors but now they have this ability.

Implementation

  • extract code that runs in a go routine for request execution to its own module
    • also removes need for a seperate networkErrorChannel
  • remove visitToChannel function
  • Properly use IPLD SkipMe's so we can complete graphsync requests where provider is missing some branches

Copy link

@ribasushi ribasushi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with a freely-ignorable nit.

Comment on lines -443 to +431
selector, err := ipldutil.ParseSelector(selectorSpec)
_, err = ipldutil.ParseSelector(selectorSpec)
if err != nil {
return gsmsg.GraphSyncRequest{}, hooks.RequestResult{}, nil, err
return gsmsg.GraphSyncRequest{}, hooks.RequestResult{}, err

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! my only nit would be that I'd rewire this error check into an inlined version. Otherwise it seems like .ParseSelector has side-effects ( also do you even need to check .EncodeNode above? )

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh shoot. just realized what you're saying. will fix in later PR

@hannahhoward hannahhoward merged commit a878543 into master Jul 1, 2020
@aschmahmann aschmahmann mentioned this pull request Sep 22, 2020
72 tasks
@mvdan mvdan deleted the feat/refactor-request-execution branch December 15, 2021 14:16
marten-seemann pushed a commit that referenced this pull request Mar 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants